	/**
	 * 用户名密码验证
	 */
function loginValidate(userCode,password){
		if(userCode == ''){
			Pearlsen.Utils.showInfoMsg("请您输入用户名!");
			Ext.getDom("userName").focus();
			return false;
		}
		
		if(password== ''){
			Pearlsen.Utils.showInfoMsg('请您输入密码!');
			Ext.getDom("password").focus();
			return false;
		}
		return true;
	}
function doLogin(){
	var _username = Ext.getDom("userName").value;
	var _password = Ext.getDom("password").value;
	if(!loginValidate(_username,_password)){
		return false;
	}
	var query=new Query('SysUserLoadHandler','SysUserDataSetHandler');
		query.setHandlerMethod("doLogin");
		query.addCondition("user_name",_username);
		query.addCondition("user_password",_password);
		var ds=query.load();
		if(ds==null||ds.size()==0){
			Pearlsen.Utils.showErrorMsg("登入失败");
		}else{
			ds.next();
			if(ds.getValue("status")=='success'){
//				var cookie = new Pearlsen.Utils.Cookie();
//				var username = ds.getValue("user_name");
//				var user_name = cookie.getCookie("pearlsen_"+ds.getValue("user_name"));
//				alert(user_name);
				window.location="home.jsp";
			}
			else{
				Pearlsen.Utils.showErrorMsg("登入失败");
			}
		}
	
}